<?php

class Application_Form_Comments extends Zend_Form
{

	public function init()
	{
		$this->setName('Commentaire');


		$comment = new Zend_Form_Element_Textarea('text');
		$comment->setLabel('Contenu du commentaire')
			->setRequired(true)
			->addFilter('StripTags') // pas de balise
			->addValidator('NotEmpty') // pas vide
			->setAttrib('COLS', '40')
			->setAttrib('ROWS', '6');
			
		$publickey ='6LfvwMoSAAAAAD7HmdLB_r2x9KR_WPP01RlYQrS0' ;
		$privatekey = '6LfvwMoSAAAAAAQNw8Toz0nD8MCdFxlvzSbJd_Qv' ;
		$recaptcha = new Zend_Service_ReCaptcha($publickey, $privatekey);
		
		$captcha = new Zend_Form_Element_Captcha('challenge',array(
			'captcha' => 'ReCaptcha',
			'captchaOptions' => array(
			'captcha' => 'ReCaptcha',
			'service' => $recaptcha)));

		$envoyer = new Zend_Form_Element_Submit('Envoyer');
		$envoyer->setAttrib('id', 'boutonenvoyer');

		$this->addElements(array($comment, $captcha, $envoyer));
	}


}

